import { ResPage, Money } from "@/api/interface/index";
import { MONEY } from "@/api/config/servicePort";
import http from "@/api";

// 获取发票列表
export const getBillList = (params: Money.ReqBillParams) => {
  return http.post<ResPage<Money.ResBillList>>(MONEY + `/bill/list`, params);
};

// 新增发票
export const addBill = (params: any) => {
  return http.post(MONEY + `/bill/add`, params);
};

// 批量添加发票
export const BatchAddBill = (params: FormData) => {
  return http.post(MONEY + `/bill/import`, params);
};

// 领用发票
export const editBill = (params: Money.BillInfo) => {
  return http.post(MONEY + `/bill/edit`, params);
};

// 导出发票数据
export const exportBillInfo = (params: Money.ReqBillParams) => {
  return http.download(MONEY + `/bill/export`, params);
};

// 发票作废
export const stopBill = (params: { billId: number }) => {
  return http.post(MONEY + `/bill/stop`, params);
};

//获得供应商结算列表
export const getSupplierList = (params: Money.ReqSupplierParams) => {
  return http.post<ResPage<Money.ResSupplierList>>(MONEY + `/supplier/list`, params);
};
